package main

import (
	_ "crawl_toutiao/models"
	_ "crawl_toutiao/routers"
	"flag"
	"fmt"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
	"os"
)

//var configJsonFile string
var version string = "1.0"

func init() {
	//flag.StringVar(&configJsonFile, "c", "config.json", "config file")
	flag.StringVar(&version, "v", "1.0", "app version")
	flag.Parse()
}

//go run main.go -c config.json
//go run main.go -v 1.0
func main() {
	fmt.Printf("%s  app version:%s\n", os.Args[0], version)
	logs.SetLogger(logs.AdapterFile, `{"filename": "logs/app.log"}`)
	logs.EnableFuncCallDepth(true)
	logs.Async()
	logs.Async(1e3)
	beego.Run()
}
